#pragma once

#include "vrdatacore_global.h"
#include "scene.h"
#include "viewer.h"
#include "lightactorbase.h"
#include <QVector>
#include "map.h"

namespace VrDataCore
{
	class VRDATACORE_EXPORT LightSourceManager
	{
	public:
		static LightSourceManager& GetInstance();
		void initManager(CoreBase::Viewer* viewer,CoreBase::Scene* scene);
		void initDefaultLightSource();
		void addLightSource(osg::ref_ptr<CoreBase::ActorBase> lightsource);
		void removeLightSource(osg::ref_ptr<CoreBase::ActorBase> lightsource);
		void clear();
		QVector<osg::ref_ptr<CoreBase::ActorBase>> getAllLightSource();
		//map change
		void setCurrentMap(CoreBase::Map* mcurrmap);
	private:
		LightSourceManager();
		~LightSourceManager();
		static LightSourceManager*												_manager;
		CoreBase::Scene*														_currentScene;
		CoreBase::Viewer*														_currentView;
		QVector<osg::ref_ptr<CoreBase::ActorBase>>								_childVector;
		CoreBase::Map*															_currentMap;
	};
}